const mongoose = require('mongoose')
mongoose.set('debug', true)

const init = async () => {
  await mongoose.connect(
    'mongodb://user:123456@192.168.1.240:27017/vue?authSource=admin',
    // 'mongodb+srv://kelvins:kelvins@cluster0.hjodj.azure.mongodb.net/vue-permission?retryWrites=true&w=majority',
    {
      useNewUrlParser: true,
      useUnifiedTopology: true
    }
  )
  console.log('mongodb 连接正常')
}

module.exports = init
